package com.xiaopeng.common.jsql.enums;

import java.util.Arrays;
import java.util.List;

/**
 * 运算条件 枚举
 * @author caixiaopeng
 */
public enum JsqlOperationEnum {

    LIKE("like", "模糊匹配"),
    EQ("eq", "等于"),
    NOT_EQ("not_eq", "不等于"),
    LT("lt", "小于"),
    LE("le", "小于等于"),
    GT("gt", "大于"),
    GE("ge", "大于等于"),
    NULL("null", "空"),
    NOT_NULL("not_null", "不为空"),
    IN("in", "包含"),
    NOT_IN("not_in", "不包含"),

    ;

    private String value;
    private String name;

    JsqlOperationEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    // 数字擦配置
    public static final List<String> getNumberOperation(){
        return Arrays.asList(EQ.getValue(), NOT_EQ.getValue(), LT.getValue(), LE.getValue(), GT.getValue(), GE.getValue());
    }

    // 下拉框配置
    public static List<String> getSelectOperation(){
        return Arrays.asList(EQ.getValue(), NOT_EQ.getValue(), IN.getValue(), NOT_IN.getValue());
    }
}
